import type { BaseTableConfig } from '@/components/base-ui/base-table/type';
import { widthLevel2, widthLevel3, thWordLength4, thWordLength5, widthLevel1 } from '@/config';

export const tableConfig: BaseTableConfig = {
    items: [
        {
            modelKey: 'orderNumber',
            slotName: 'orderNumber',
            columnProps: {
                label: '订单号',
                width: widthLevel2 + 40
            }
        },
        {
            modelKey: 'itemCode',
            slotName: 'itemCode',
            columnProps: {
                label: '物料编码',
                width: widthLevel2
            }
        },
        {
            modelKey: 'itemName',
            columnProps: {
                label: '物料名称',
                width: widthLevel2
            }
        },
        {
            modelKey: 'manufacturingStrategy',
            columnProps: {
                label: '制造策略',
                width: thWordLength4
            }
        },
        {
            modelKey: 'orderPriority',
            slotName: 'orderPriority',
            sortUrlKey: 'order_priority',
            sortItem: true,
            columnProps: {
                label: '订单优先级',
                width: thWordLength5 + 60
            },
            otherConfig: {
                tip: true,
                tipMsg: '优先级越高，数字越小。'
            }
        },
        {
            modelKey: 'orderQuantity',
            columnProps: {
                label: '产品数量',
                width: thWordLength4
            }
        },
        {
            modelKey: 'itemStock',
            columnProps: {
                label: '实际库存',
                width: thWordLength4
            }
        },
        {
            modelKey: 'plannedQuantity',
            columnProps: {
                label: '计划数量',
                width: thWordLength4
            }
        },
        {
            modelKey: 'plannedStartTime',
            columnProps: {
                label: '计划开始时间',
                width: widthLevel1
            }
        },
        {
            modelKey: 'plannedEndTime',
            columnProps: {
                label: '计划结束时间',
                width: widthLevel1
            }
        },
        {
            modelKey: 'orderDeliveryDate',
            sortItem: true,
            sortUrlKey: 'order_delivery_date',
            columnProps: {
                label: '订单交期',
                width: widthLevel3 + 10
            }
        },
        {
            modelKey: 'planExtension',
            slotName: 'planExtension',
            columnProps: {
                label: '计划延期(天)',
                width: thWordLength5 + 30
            },
            otherConfig: {
                tip: true,
                tipMsg: '负数为计划结束时间早于订单交期，正数和0为计划结束时间晚于或等于订单交期。'
            }
        }
    ]
};
